package part_05_Thread_Pools;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class App0 {
	public static void main(String[] args) {

		ExecutorService executor = Executors.newFixedThreadPool(2);

		for (int j = 0; j < 5; j++) {

			executor.submit(new Processor(j));

		}

		executor.shutdown();   //didnt quite get this
		try {
			executor.awaitTermination(1, TimeUnit.SECONDS);//didnt quite get this
			
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
